/**
 * 
 */
package org.sunnyleaf.votedemo.client.ui;

import com.google.gwt.user.client.ui.Button;
import com.google.gwt.user.client.ui.CheckBox;
import com.google.gwt.user.client.ui.Composite;
import com.google.gwt.user.client.ui.DecoratorPanel;
import com.google.gwt.user.client.ui.Label;
import com.google.gwt.user.client.ui.RadioButton;
import com.google.gwt.user.client.ui.VerticalPanel;

/**
 * @author Administrator
 *
 */
public class VotePanel extends Composite{

	private static int vinstanceid = 0;
	
	private Button submit = new Button("提交");
	
	public VotePanel() {

		VerticalPanel vp1 = new VerticalPanel();
		vp1.add(new VoteItemPanel());
		vp1.add(new VoteItemPanel());
		vp1.add(new VoteItemPanel());
		
		
		vp1.add(submit );
		
		DecoratorPanel dp = new DecoratorPanel();
		dp.add(vp1);
		
		this.initWidget(dp);
		
	}
	
	
	class VoteItemPanel extends Composite{
		
		public VoteItemPanel() {
			vinstanceid++;
			
			VerticalPanel vp = new VerticalPanel();
			
			vp.add(new Label(vinstanceid+". "+"这里是问题"+vinstanceid));
			
			vp.add(new RadioButton("option"+vinstanceid, "这里是选项一"));
			vp.add(new RadioButton("option"+vinstanceid, "这里是选项二"));
			vp.add(new RadioButton("option"+vinstanceid, "这里是选项三"));
			
			vp.add(new CheckBox("弃权"));
			
			this.initWidget(vp);
			
		}
	}
}
